package com.yq.spbYq.service.impl;

import com.yq.spbYq.WasteRecord;
import com.yq.spbYq.mapper.WasteRecordMapper;
import com.yq.spbYq.service.WasteRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WasteRecordServiceimpl implements WasteRecordService {
    @Autowired
    private WasteRecordMapper wasteRecordMapper;
    //查询
    @Override
    public List<WasteRecord> selectWasteRecord(){
        return wasteRecordMapper.selectWasteRecord();
    }
    @Override
    public List<WasteRecord> selectWasteRecordByResidentId(Long residentId){
        return wasteRecordMapper.selectWasteRecordByResidentId(residentId);
    }
    @Override
    public WasteRecord addWasteRecord(WasteRecord wasteRecord){
        wasteRecordMapper.insertWasteRecord(wasteRecord);
        return wasteRecord;
    }
    @Override
    public void deleteWasteRecord(Long id){
        wasteRecordMapper.deleteWasteRecord(id);
    }
}
